﻿#region Usings

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

#endregion

namespace xConnected.Core.Model
{
    [Serializable]
    [DataContract]
    [DisplayColumn("Subject")]
    public partial class Message : PersistentEntity
    {
        public Message()
        {
            AllRecipientsVisible = true;
            Children = new List<Message>();
            IsChecked = false;
        }

        [DataMember]
        public string Subject { get; set; }

        [DataMember]
        public string Body { get; set; }

        [DataMember]
        public bool AllRecipientsVisible { get; set; }

        [DataMember]
        public virtual bool IsChecked { get; set; }

        [DataMember]
        public virtual int? ParentId { get; set; }

        [DataMember]
        public virtual Message Parent { get; set; }

        [DataMember]
        public virtual IList<Message> Children { get; set; }

        [DataMember]
        public virtual IList<MessageExpertUser> MessageExpertUsers { get; set; }

        [DataMember]
        public virtual IList<MessageCompanyUser> MessageCompanyUsers { get; set; }

        [DataMember]
        public virtual IList<MessagePositionUser> MessagePositionUsers { get; set; }
    }
}
